import request from './request'
import type { LoginForm, UserInfo } from '@/types/auth'

export const login = (data: LoginForm) => {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export const getUserInfo = () => {
  return request({
    url: '/user/userinfo',
    method: 'get'
  })
}

export const logout = () => {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}